<?php
require_once("init.php");
$id=$_GET['id'];
$ftype=$_GET['ftype'];
$type=$_GET['type'];
$page=$_GET['page'];
if($ftype=="fav") {
    $url="http://twitter.com/favorites/create/".$id.".json";
} else {
    $url="http://twitter.com/favorites/destroy/".$id.".json";
}
post_to_twitter($url,"");
header("Location: index.php?type=".$type."&page=".$page);
?>